package com.blacktea.structuralpatterns.compositepattern.component;

import java.util.function.Consumer;

/**
 * @description: 组件类
 * @author: black tea
 * @date: 2023/3/22 17:59
 */
public abstract class Component<T> {

    protected String name;

    protected Consumer<T> consumer;

    public Component(String name, Consumer<T> consumer) {
        this.name = name;
        this.consumer = consumer;
    }

    public abstract void operation(T data);

}
